module tb_shift_16;
	reg [15:0] In;
	reg [3:0] Cnt;
	reg [1:0] Op;
	wire [15:0] Out;
	reg [2:0] i;

	shift_16 DUB(.In(In), .Cnt(Cnt), .Op(Op), .Out(Out));

	initial
	begin
		In = 16'h00ff;

		#10
		for(i=3'b000; i!=3'b100; i=i+1) begin
		#10
		Op = i[1:0];

		Cnt = 4'b0000;

		#10
		Cnt = 4'b0001;

		#10
		Cnt = 4'b0011;

		#10
		Cnt = 4'b0100;

		#10
		Cnt = 4'b1010;

		end

		In = 16'hff00;

		#10
		for(i=3'b000; i!=3'b100; i=i+1) begin
		#10
		Op = i[1:0];

		Cnt = 4'b0000;

		#10
		Cnt = 4'b0001;

		#10
		Cnt = 4'b0011;

		#10
		Cnt = 4'b0100;

		#10
		Cnt = 4'b1010;
		end
	end

	always@(In, Cnt, Op, Out)
	begin
		#2
		case (Op[1:0])
		2'b00:	$display("rotate left: In: %b, Cnt: %b, Out %b", In, Cnt, Out);
		2'b01:	$display("shift left: In: %b, Cnt: %b, Out %b", In, Cnt, Out);
		2'b10:	$display("rotate right: In: %b, Cnt: %b, Out %b", In, Cnt, Out);
		2'b11:	$display("shift right arith: In: %b, Cnt: %b, Out %b", In, Cnt, Out);
		endcase
	end
endmodule	


